package oop;

public class Student {
    String name;
    double chinese;
    double math;
    double score;

    public void printTotalScore(){
        System.out.println(name + "的总成绩是" + (chinese + math));
    }

    public void  printAverageScore(){
        System.out.println(name + "的平均成绩是" + (chinese + math) / 2.0);
    }

    public void printThis(){
        System.out.println(this);
    }

    public void printPass(double score){
        if(this.score > score){
            System.out.println("恭喜您被录取了");
        }else {
            System.out.println("很遗憾，您落选了。");
        }
    }


    class Car{
        //可以构造多个不同的对象，但是不能加"public"
    }

    public Student(){
        //构造器（可以重载）
        System.out.println("无参数的构造器被执行了");
    }

    public Student(String name, double score){
        //重载的构造器
        System.out.println("有参数的构造器被执行了");
    }
}
